<?php

require($_SERVER['DOCUMENT_ROOT'] . "/bootstrap.php");

if (isset($_GET['idarticle']))
	$idarticle = ($_GET['idarticle']);
else {
	$idarticle = '';
}
$smarty->assign('idarticle', $idarticle);


$sql = mysql_query("select * from article where idarticle=$idarticle");
$article = mysql_fetch_array($sql);
$smarty->assign('article', $article);


$sql1 = mysql_query("select * from article where idarticle!=$idarticle ORDER BY idarticle DESC limit 0,6");
while ($row = mysql_fetch_array($sql1)) {
	$article_khac[] = $row;
}
$smarty->assign('article_khac', $article_khac);


$sql2 = mysql_query("select * from article ORDER BY idarticle DESC limit 0,10");
while ($row = mysql_fetch_array($sql2)) {
	$article_full[] = $row;
}
$smarty->assign('article_full', $article_full);


$smarty->display('../templates/article/index.tpl');
?>